import UIKit

@available(iOS 3.0, *)
extension QKC where AA :UIMenuController {
		// default is NO
    open func isMenuVisible_qk_s(_ isMenuVisible:  Bool ) -> QKC<AA,YY,ZZ, Bool >{
		return link(next: isMenuVisible).then_QK { $0.value.isMenuVisible = isMenuVisible }
	}
    open func isMenuVisible_qk_g() -> QKC<AA,YY,ZZ, Bool >{
		 self +^ self.value.isMenuVisible
	}

		// default is UIMenuControllerArrowDefault
    @available(iOS 3.2, *)
    open func arrowDirection_qk_s(_ arrowDirection:  UIMenuController.ArrowDirection ) -> QKC<AA,YY,ZZ, UIMenuController.ArrowDirection >{
		return link(next: arrowDirection).then_QK { $0.value.arrowDirection = arrowDirection }
	}
    @available(iOS 3.2, *)
    open func arrowDirection_qk_g() -> QKC<AA,YY,ZZ, UIMenuController.ArrowDirection >{
		 self +^ self.value.arrowDirection
	}

		// default is nil. these are in addition to the standard items
    @available(iOS 3.2, *)
    open func menuItems_qk_s(_ menuItems:  [UIMenuItem]? ) -> QKC<AA,YY,ZZ, [UIMenuItem]? >{
		return link(next: menuItems).then_QK { $0.value.menuItems = menuItems }
	}
    @available(iOS 3.2, *)
    open func menuItems_qk_g() -> QKC<AA,YY,ZZ, [UIMenuItem]? >{
		 self +^ self.value.menuItems
	}

    open func menuFrame_qk_g() -> QKC<AA,YY,ZZ, CGRect >{
		 self +^ self.value.menuFrame
	}

    @available(iOS, introduced: 3.0, deprecated: 13.0, message: "Use showMenuFromView:rect: or hideMenuFromView: instead.")
    open func setMenuVisible_qk_f(_ menuVisible: Bool, animated: Bool) -> QKC<AA,YY,ZZ, Bool>{
		 self +^ self.value.setMenuVisible(menuVisible, animated:animated) +^ menuVisible
	}

    @available(iOS, introduced: 3.0, deprecated: 13.0, message: "Use showMenuFromView:rect: instead.")
    open func setTargetRect_qk_f(_ targetRect: CGRect, in targetView: UIView) -> QKC<AA,YY,ZZ, CGRect>{
		 self +^ self.value.setTargetRect(targetRect, in:targetView) +^ targetRect
	}

    @available(iOS 13.0, *)
    open func showMenu_qk_f(from targetView: UIView, rect targetRect: CGRect) -> QKC<AA,YY,ZZ, UIView>{
		 self +^ self.value.showMenu(from:targetView, rect:targetRect) +^ targetView
	}

    @available(iOS 13.0, *)
    open func hideMenu_qk_f(from targetView: UIView) -> QKC<AA,YY,ZZ, UIView>{
		 self +^ self.value.hideMenu(from:targetView) +^ targetView
	}

    @available(iOS 13.0, *)
    open func hideMenu_qk_f() -> QKC<AA,YY,ZZ,Void>{
		 self +^ self.value.hideMenu()
	}

    open func update_qk_f() -> QKC<AA,YY,ZZ,Void>{
		 self +^ self.value.update()
	}

}

@available(iOS 3.2, *)
extension QKC where AA :UIMenuItem {
    open func title_qk_s(_ title:  String) -> QKC<AA,YY,ZZ, String>{
		return link(next: title).then_QK { $0.value.title = title }
	}
    open func title_qk_g() -> QKC<AA,YY,ZZ, String>{
		 self +^ self.value.title
	}

    open func action_qk_s(_ action:  Selector) -> QKC<AA,YY,ZZ, Selector>{
		return link(next: action).then_QK { $0.value.action = action }
	}
    open func action_qk_g() -> QKC<AA,YY,ZZ, Selector>{
		 self +^ self.value.action
	}

}

